package com.spark.sparkanswerserver;

import org.spark.config.DefaultFeignConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableFeignClients(basePackages = "org.spark.clients",defaultConfiguration = DefaultFeignConfiguration.class)
public class SparkAnswerServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(SparkAnswerServerApplication.class, args);
    }
    @Bean
    @LoadBalanced
    /**
     * @LoadBalanced作用就是负载均衡，
     */
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

}
